package com.inspectionwork.web.web;

import cn.hutool.json.JSONObject;
import com.inspectionwork.common.base.BaseController;
import com.inspectionwork.support.annotaion.Action;
import com.inspectionwork.support.annotaion.At;
import com.inspectionwork.support.model.RespEntity;
import com.inspectionwork.web.service.InspectionworkService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * 检查工作下发控制器
 */
@Action
@RequestMapping(value="inspectionwork")
public class InspectionworkController extends BaseController {
    @Resource
    public InspectionworkService inspectionworkService;

    /**
     * 检查工作下发列表查询
     * @param
     * @return
     */
    @At(value = "listInspectionworkListPage", method = RequestMethod.GET)
    public RespEntity listInspectionworkListPage(@RequestBody(required = false) JSONObject jsonParam){
        return inspectionworkService.listInspectionworkListPage(jsonParam);
    }

    /**
     * 检查落实任务列表：单位用
     * @param
     * @return
     */
    @At(value = "workableList", method = RequestMethod.GET)
    public RespEntity workableList(@RequestBody(required = false) JSONObject jsonParam){
        return inspectionworkService.workableList(jsonParam);
    }

    /**
     * 检查工作下发列表新增
     * @param
     * @return
     */
    @At(value = "add", method = RequestMethod.POST)
    public RespEntity add(@RequestBody(required = false) JSONObject jsonParam) {
        return inspectionworkService.addInspectionwork(jsonParam);
    }

    /**
     * 检查工作下发详情
     * @param
     * @return
     */
    @At(value = "getById", method = RequestMethod.GET)
    public RespEntity getById(@RequestBody(required = false) JSONObject jsonParam) {
        return inspectionworkService.getById(jsonParam);
    }

    /**
     * 单位的落实情况列表
     * @param
     * @return
     */
    @At(value = "workableBusinessListPage", method = RequestMethod.GET)
    public RespEntity workableBusinessListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return inspectionworkService.workableBusinessListPage(jsonParam);
    }

    /**
     * 单位落实
     * @param
     * @return
     */
    @At(value = "workable", method = RequestMethod.POST)
    public RespEntity workable(@RequestBody(required = false) JSONObject jsonParam) {
        return inspectionworkService.workable(jsonParam);
    }

    /**
     * 单位落实修改为未落实
     * @param
     * @return
     */
    @At(value = "workableNo", method = RequestMethod.POST)
    public RespEntity workableNo(@RequestBody(required = false) JSONObject jsonParam) {
        return inspectionworkService.workableNo(jsonParam);
    }

    /**
     * 字典组查询
     * @param
     * @return
     */
    @At(value = "dictList", method = RequestMethod.GET)
    public RespEntity dictList(@RequestBody(required = false) JSONObject jsonParam) {
        return inspectionworkService.dictList(jsonParam);
    }
    //检查工作下发删除
    @At(value = "delete", method = RequestMethod.POST)
    public RespEntity delete(@RequestBody(required = false) JSONObject jsonParam) {
        return inspectionworkService.delete(jsonParam);
    }
}